package com.bocom.config;

import com.bocom.Intercepter.SecurityInterceptor;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;

/**
 * Author shenzhifeng
 * Create time  2019/9/23 10:00
 * Description
 * Modifier
 * Reasons
 */
//@Configuration
public class SpirngMvcConfig extends WebMvcConfigurerAdapter {

    public static final String SESSION_KEY = "username";

    @Override
    public void addInterceptors(InterceptorRegistry registry) {
//        TimeOutIntercepter timeOutIntercepter = new TimeOutIntercepter();
//        String allowUrls[] = {"login","logout"};
//        timeOutIntercepter.setAllowUrls(allowUrls);
//        //添加拦截器
//        registry.addInterceptor(timeOutIntercepter);
//
//        super.addInterceptors(registry);


        SecurityInterceptor securityInterceptor = new SecurityInterceptor();
        //添加拦截器
        registry.addInterceptor(securityInterceptor);

        super.addInterceptors(registry);

    }
}
